<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 * HITI AdminCP
 *
 * @package     HITI AdminCP Project
 * @since       Monday, October 21, 2013, 6:00 PM
 * @final       
 * @category    Models
 * @see 		Profile
 * @author      PHUOCNGUYEN - HITI Dev Team
 * @copyright   Copyright (c) 2013, HITI Corp
 */

class Profile_model extends CI_Model {
	public function __construct()
	{
		parent::__construct();
	}

	public function user($id)
	{
		$this->db->query('SET NAMES "LATIN1"');
		$this->db->where('id', $id);
		$query = $this->db->get('users');
		if ($query->num_rows() > 0)
		{
			return $query->row_array();
		}
		else
		{
			return false;
		}
	}

	public function update($data, $id)
	{
		if (!is_array($data))
		{
			return false;
		}
	  	$this->db->where('id', $id);
	    $this->db->update('users', $data);
	    write_log('update_profile');
	    return true;
	}
}

/* End of file profile_model.php */
/* Location: ./application/models/profile_model.php */